Skip to content

Migrate llvm-profdata to Opt flag parsing - #177868

Open
dzbarsky wants to merge 6 commits into
llvm:mainfrom
dzbarsky:llvm-profdata
Open

dzbarsky wants to merge 6 commits into
llvm:mainfrom
dzbarsky:llvm-profdata

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor

Similar to https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

-t=d is removed. Use -t d instead.
--demangle=0 cannot be used. Omit the option or use --no-demangle instead.
--help-list is removed. This is a cl:: specific option.

Motivation: So we can undo 3f52eef and bring it back into the driver

@llvmbot llvmbot added the PGO Profile Guided Optimizations label Jan 25, 2026
@llvmbot

llvmbot commented Jan 25, 2026 •

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-bolt
@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-pgo

Author: David Zbarsky (dzbarsky)

Changes

Patch is 64.68 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/177868.diff

3 Files Affected:

  • (modified) llvm/tools/llvm-profdata/CMakeLists.txt (+7)
  • (added) llvm/tools/llvm-profdata/Opts.td (+314)
  • (modified) llvm/tools/llvm-profdata/llvm-profdata.cpp (+616-461)
diff --git a/llvm/tools/llvm-profdata/CMakeLists.txt b/llvm/tools/llvm-profdata/CMakeLists.txt
index e5aa858f3d39c..2a98ed0be0fb5 100644
--- a/llvm/tools/llvm-profdata/CMakeLists.txt
+++ b/llvm/tools/llvm-profdata/CMakeLists.txt
@@ -2,14 +2,21 @@ set(LLVM_LINK_COMPONENTS
   Core
   Object
   ProfileData
+  Option
   Support
   )
 
+set(LLVM_TARGET_DEFINITIONS Opts.td)
+tablegen(LLVM Opts.inc -gen-opt-parser-defs)
+add_public_tablegen_target(ProfdataOptsTableGen)
+
 add_llvm_tool(llvm-profdata
   llvm-profdata.cpp
 
   DEPENDS
   intrinsics_gen
+  ProfdataOptsTableGen
+  GENERATE_DRIVER
   )
 
 target_link_libraries(llvm-profdata PRIVATE LLVMDebuginfod)
diff --git a/llvm/tools/llvm-profdata/Opts.td b/llvm/tools/llvm-profdata/Opts.td
new file mode 100644
index 0000000000000..8803af9a10123
--- /dev/null
+++ b/llvm/tools/llvm-profdata/Opts.td
@@ -0,0 +1,314 @@
+include "llvm/Option/OptParser.td"
+
+def Show : SubCommand<"show",
+                      "Takes a profile data file and displays the profiles. "
+                      "See detailed documentation in "
+                      "https://llvm.org/docs/CommandGuide/llvm-profdata.html"
+                      "#profdata-show">;
+def Order : SubCommand<"order",
+                       "Reads temporal profiling traces from a profile and "
+                       "outputs a function order that reduces page faults. "
+                       "See detailed documentation in "
+                       "https://llvm.org/docs/CommandGuide/llvm-profdata.html"
+                       "#profdata-order">;
+def Overlap : SubCommand<"overlap",
+                         "Computes the overlap between two profiles. See "
+                         "detailed documentation in "
+                         "https://llvm.org/docs/CommandGuide/llvm-profdata.html"
+                         "#profdata-overlap">;
+def Merge : SubCommand<"merge",
+                       "Takes several profiles and merge them together. See "
+                       "detailed documentation in "
+                       "https://llvm.org/docs/CommandGuide/llvm-profdata.html"
+                       "#profdata-merge">;
+
+def help : Flag<["-","--"], "help", [Show, Order, Overlap, Merge]>,
+           HelpText<"Display this help">;
+def help_hidden : Flag<["--"], "help-hidden", [Show, Order, Overlap, Merge]>,
+                  HelpText<"Display all help, including hidden options">;
+def version : Flag<["--"], "version", [Show, Order, Overlap, Merge]>,
+              HelpText<"Display the version">;
+
+def output : JoinedOrSeparate<["-","--"], "output",
+                               [Show, Order, Overlap, Merge]>,
+             MetaVarName<"<output>">,
+             HelpText<"Output file">;
+def : JoinedOrSeparate<["-"], "o", [Show, Order, Overlap, Merge]>,
+     Alias<output>, HelpText<"Alias for --output">;
+
+def instr : Flag<["-","--"], "instr", [Show, Overlap, Merge]>,
+            HelpText<"Instrumentation profile (default)">;
+def sample : Flag<["-","--"], "sample", [Show, Overlap, Merge]>,
+             HelpText<"Sample profile">;
+def memory : Flag<["-","--"], "memory", [Show]>,
+             HelpText<"MemProf memory access profile">;
+
+def max_debug_info_correlation_warnings
+    : JoinedOrSeparate<["-","--"], "max-debug-info-correlation-warnings",
+                       [Show, Merge]>,
+      HelpText<"Maximum number of warnings to emit when correlating profile "
+               "from debug info (0 = no limit)">,
+      MetaVarName<"<n>">;
+def profiled_binary
+    : JoinedOrSeparate<["-","--"], "profiled-binary", [Show, Merge]>,
+      HelpText<"Path to binary from which the profile was collected.">,
+      MetaVarName<"<binary>">;
+def debug_info
+    : JoinedOrSeparate<["-","--"], "debug-info", [Show, Merge]>,
+      HelpText<"For show, read and extract profile metadata from debug info. "
+               "For merge, correlate the raw profile using the provided "
+               "debug info.">,
+      MetaVarName<"<file>">;
+def binary_file
+    : JoinedOrSeparate<["-","--"], "binary-file", [Merge]>,
+      HelpText<"Use the provided unstripped binary to correlate the raw "
+               "profile.">,
+      MetaVarName<"<file>">;
+def debug_file_directory
+    : JoinedOrSeparate<["-","--"], "debug-file-directory",
+                       [Show, Order, Overlap, Merge]>,
+      HelpText<"Directories to search for object files by build ID">,
+      MetaVarName<"<dir>">;
+def debuginfod : Flag<["-","--"], "debuginfod", [Merge]>,
+                 HelpText<"Enable debuginfod">, Flags<[HelpHidden]>;
+def correlate : JoinedOrSeparate<["-","--"], "correlate",
+                                  [Show, Order, Overlap, Merge]>,
+                HelpText<"Use debug-info or binary correlation to correlate "
+                         "profiles with build id fetcher">,
+                MetaVarName<"<mode>">;
+def function : JoinedOrSeparate<["-","--"], "function",
+                                [Show, Overlap, Merge]>,
+               HelpText<"Only functions matching the filter are shown or "
+                        "merged.">,
+               MetaVarName<"<regex>">;
+
+def weighted_input
+    : JoinedOrSeparate<["-","--"], "weighted-input", [Merge]>,
+      HelpText<"<weight>,<filename>">, MetaVarName<"<weight>,<file>">;
+def binary : Flag<["-","--"], "binary", [Merge]>,
+             HelpText<"Binary encoding">;
+def extbinary : Flag<["-","--"], "extbinary", [Merge]>,
+                HelpText<"Extensible binary encoding (default)">;
+def text : Flag<["-","--"], "text", [Show, Merge]>,
+           HelpText<"Text output format">;
+def gcc : Flag<["-","--"], "gcc", [Merge]>,
+          HelpText<"GCC encoding (only meaningful for -sample)">;
+def input_files
+    : JoinedOrSeparate<["-","--"], "input-files", [Merge]>,
+      HelpText<"Path to file containing newline-separated "
+               "[<weight>,]<filename> entries">,
+      MetaVarName<"<file>">;
+def : JoinedOrSeparate<["-"], "f", [Merge]>, Alias<input_files>,
+     HelpText<"Alias for --input-files">;
+def dump_input_file_list : Flag<["-","--"], "dump-input-file-list", [Merge]>,
+                           HelpText<"Dump the list of input files and their "
+                                    "weights, then exit">,
+                           Flags<[HelpHidden]>;
+def remapping_file
+    : JoinedOrSeparate<["-","--"], "remapping-file", [Merge]>,
+      HelpText<"Symbol remapping file">, MetaVarName<"<file>">;
+def : JoinedOrSeparate<["-"], "r", [Merge]>, Alias<remapping_file>,
+     HelpText<"Alias for --remapping-file">;
+def use_md5 : Flag<["-","--"], "use-md5", [Merge]>,
+              HelpText<"Use MD5 to represent strings in the name table "
+                       "(only meaningful for -extbinary)">,
+              Flags<[HelpHidden]>;
+def compress_all_sections
+    : Flag<["-","--"], "compress-all-sections", [Merge]>,
+      HelpText<"Compress all sections when writing the profile (only "
+               "meaningful for -extbinary)">,
+      Flags<[HelpHidden]>;
+def sample_merge_cold_context
+    : Flag<["-","--"], "sample-merge-cold-context", [Merge]>,
+      HelpText<"Merge context sample profiles whose count is below cold "
+               "threshold">,
+      Flags<[HelpHidden]>;
+def sample_trim_cold_context
+    : Flag<["-","--"], "sample-trim-cold-context", [Merge]>,
+      HelpText<"Trim context sample profiles whose count is below cold "
+               "threshold">,
+      Flags<[HelpHidden]>;
+def sample_frame_depth_for_cold_context
+    : JoinedOrSeparate<["-","--"], "sample-frame-depth-for-cold-context",
+                       [Merge]>,
+      HelpText<"Keep the last K frames while merging cold profile. 1 means "
+               "the context-less base profile">,
+      Flags<[HelpHidden]>, MetaVarName<"<depth>">;
+def output_size_limit
+    : JoinedOrSeparate<["-","--"], "output-size-limit", [Merge]>,
+      HelpText<"Trim cold functions until profile size is below specified "
+               "limit in bytes">,
+      Flags<[HelpHidden]>, MetaVarName<"<bytes>">;
+def gen_partial_profile
+    : Flag<["-","--"], "gen-partial-profile", [Merge]>,
+      HelpText<"Generate a partial profile (only meaningful for -extbinary)">,
+      Flags<[HelpHidden]>;
+def split_layout : Flag<["-","--"], "split-layout", [Merge]>,
+                   HelpText<"Split the profile into sections with and without "
+                            "inlined functions (only meaningful for "
+                            "-extbinary)">,
+                   Flags<[HelpHidden]>;
+def supplement_instr_with_sample
+    : JoinedOrSeparate<["-","--"], "supplement-instr-with-sample", [Merge]>,
+      HelpText<"Supplement an instr profile with a sample profile. Output "
+               "will be in instr format.">,
+      Flags<[HelpHidden]>, MetaVarName<"<sample-profile>">;
+def zero_counter_threshold
+    : JoinedOrSeparate<["-","--"], "zero-counter-threshold", [Merge]>,
+      HelpText<"Ratio of zero counters required to drop a function when "
+               "supplementing instr profiles">,
+      Flags<[HelpHidden]>, MetaVarName<"<ratio>">;
+def suppl_min_size_threshold
+    : JoinedOrSeparate<["-","--"], "suppl-min-size-threshold", [Merge]>,
+      HelpText<"Assume functions smaller than this threshold can be inlined "
+               "and will not be adjusted based on sample profile.">,
+      Flags<[HelpHidden]>, MetaVarName<"<n>">;
+def instr_prof_cold_threshold
+    : JoinedOrSeparate<["-","--"], "instr-prof-cold-threshold", [Merge]>,
+      HelpText<"User specified cold threshold for instr profile to override "
+               "the cold threshold from profile summary.">,
+      Flags<[HelpHidden]>, MetaVarName<"<n>">;
+def temporal_profile_trace_reservoir_size
+    : JoinedOrSeparate<["-","--"], "temporal-profile-trace-reservoir-size",
+                       [Merge]>,
+      HelpText<"Maximum number of stored temporal profile traces (default: "
+               "100)">,
+      MetaVarName<"<n>">;
+def temporal_profile_max_trace_length
+    : JoinedOrSeparate<["-","--"], "temporal-profile-max-trace-length",
+                       [Merge]>,
+      HelpText<"Maximum length of a single temporal profile trace "
+               "(default: 10000)">,
+      MetaVarName<"<n>">;
+def no_function : JoinedOrSeparate<["-","--"], "no-function", [Merge]>,
+                  HelpText<"Exclude functions matching the filter from the "
+                           "output.">,
+                  MetaVarName<"<regex>">;
+def failure_mode
+    : JoinedOrSeparate<["-","--"], "failure-mode", [Merge]>,
+      HelpText<"Failure mode: warn, any, or all">,
+      MetaVarName<"<mode>">;
+def sparse : Flag<["-","--"], "sparse", [Merge]>,
+             HelpText<"Generate a sparse profile (only meaningful for -instr)">;
+def num_threads : JoinedOrSeparate<["-","--"], "num-threads", [Merge]>,
+                  HelpText<"Number of merge threads to use (default: autodetect)">,
+                  MetaVarName<"<n>">;
+def : JoinedOrSeparate<["-"], "j", [Merge]>, Alias<num_threads>,
+     HelpText<"Alias for --num-threads">;
+def prof_sym_list
+    : JoinedOrSeparate<["-","--"], "prof-sym-list", [Merge]>,
+      HelpText<"Path to file containing the list of function symbols used to "
+               "populate profile symbol list">,
+      MetaVarName<"<file>">;
+def convert_sample_profile_layout
+    : JoinedOrSeparate<["-","--"], "convert-sample-profile-layout", [Merge]>,
+      HelpText<"Convert the generated profile to a new layout: nest or flat">,
+      MetaVarName<"<layout>">;
+def drop_profile_symbol_list
+    : Flag<["-","--"], "drop-profile-symbol-list", [Merge]>,
+      HelpText<"Drop the profile symbol list when merging AutoFDO profiles "
+               "(only meaningful for -sample)">,
+      Flags<[HelpHidden]>;
+def keep_vtable_symbols
+    : Flag<["-","--"], "keep-vtable-symbols", [Merge]>,
+      HelpText<"Keep the vtable symbols in indexed profiles">,
+      Flags<[HelpHidden]>;
+def write_prev_version
+    : Flag<["-","--"], "write-prev-version", [Merge]>,
+      HelpText<"Write the previous version of indexed format for forward "
+               "compatibility.">,
+      Flags<[HelpHidden]>;
+def memprof_version
+    : JoinedOrSeparate<["-","--"], "memprof-version", [Merge]>,
+      HelpText<"Specify the version of the memprof format to use (2, 3, or 4)">,
+      Flags<[HelpHidden]>, MetaVarName<"<n>">;
+def memprof_full_schema
+    : Flag<["-","--"], "memprof-full-schema", [Merge]>,
+      HelpText<"Use the full schema for serialization">,
+      Flags<[HelpHidden]>;
+def memprof_random_hotness
+    : Flag<["-","--"], "memprof-random-hotness", [Merge]>,
+      HelpText<"Generate random hotness values">,
+      Flags<[HelpHidden]>;
+def memprof_random_hotness_seed
+    : JoinedOrSeparate<["-","--"], "memprof-random-hotness-seed", [Merge]>,
+      HelpText<"Random hotness seed to use (0 to generate new seed)">,
+      Flags<[HelpHidden]>, MetaVarName<"<n>">;
+
+def similarity_cutoff
+    : JoinedOrSeparate<["-","--"], "similarity-cutoff", [Overlap]>,
+      HelpText<"List overlapped functions with similarities below the cutoff "
+               "(percentage times 10000).">,
+      MetaVarName<"<n>">;
+def cs : Flag<["-","--"], "cs", [Overlap]>,
+         HelpText<"For context sensitive PGO counts. Does not work with "
+                  "CSSPGO.">;
+def value_cutoff
+    : JoinedOrSeparate<["-","--"], "value-cutoff", [Show, Overlap]>,
+      HelpText<"Cutoff value used for filtering. Meaning depends on subcommand">,
+      MetaVarName<"<n>">;
+
+def counts : Flag<["-","--"], "counts", [Show]>,
+             HelpText<"Show counter values for shown functions">;
+def show_format
+    : JoinedOrSeparate<["-","--"], "show-format", [Show]>,
+      HelpText<"Emit output in the selected format: text, json, or yaml">,
+      MetaVarName<"<format>">;
+def json : Flag<["-","--"], "json", [Show]>,
+           HelpText<"Show sample profile data in JSON format "
+                    "(deprecated, use --show-format=json)">;
+def ic_targets : Flag<["-","--"], "ic-targets", [Show]>,
+                 HelpText<"Show indirect call site target values">;
+def show_vtables : Flag<["-","--"], "show-vtables", [Show]>,
+                   HelpText<"Show vtable names for shown functions">;
+def memop_sizes : Flag<["-","--"], "memop-sizes", [Show]>,
+                  HelpText<"Show profiled sizes of memory intrinsic calls">;
+def detailed_summary : Flag<["-","--"], "detailed-summary", [Show]>,
+                       HelpText<"Show detailed profile summary">;
+def detailed_summary_cutoffs
+    : CommaJoined<["-","--"], "detailed-summary-cutoffs", [Show]>,
+      HelpText<"Cutoff percentages (times 10000) for generating detailed "
+               "summary">,
+      MetaVarName<"<list>">;
+def hot_func_list : Flag<["-","--"], "hot-func-list", [Show]>,
+                    HelpText<"Show profile summary of a list of hot functions">;
+def all_functions : Flag<["-","--"], "all-functions", [Show]>,
+                    HelpText<"Details for each and every function">;
+def showcs : Flag<["-","--"], "showcs", [Show]>,
+             HelpText<"Show context sensitive counts">;
+def topn : JoinedOrSeparate<["-","--"], "topn", [Show]>,
+           HelpText<"Show the list of functions with the largest internal counts">,
+           MetaVarName<"<n>">;
+def list_below_cutoff
+    : Flag<["-","--"], "list-below-cutoff", [Show]>,
+      HelpText<"Only output names of functions whose max count values are "
+               "below the cutoff value">;
+def show_prof_sym_list
+    : Flag<["-","--"], "show-prof-sym-list", [Show]>,
+      HelpText<"Show profile symbol list if it exists in the profile.">;
+def show_sec_info_only
+    : Flag<["-","--"], "show-sec-info-only", [Show]>,
+      HelpText<"Show the information of each section in the sample profile "
+               "(extbinary sample profiles only)">;
+def binary_ids : Flag<["-","--"], "binary-ids", [Show]>,
+                 HelpText<"Show binary ids in the profile.">;
+def temporal_profile_traces
+    : Flag<["-","--"], "temporal-profile-traces", [Show]>,
+      HelpText<"Show temporal profile traces in the profile.">;
+def covered : Flag<["-","--"], "covered", [Show]>,
+              HelpText<"Show only the functions that have been executed.">;
+def profile_version : Flag<["-","--"], "profile-version", [Show]>,
+                      HelpText<"Show profile version.">;
+
+def num_test_traces
+    : JoinedOrSeparate<["-","--"], "num-test-traces", [Order]>,
+      HelpText<"Keep aside the last <num-test-traces> traces when computing "
+               "function order to evaluate that order">,
+      MetaVarName<"<n>">;
+
+def fs_discriminator_pass
+    : JoinedOrSeparate<["-","--"], "fs-discriminator-pass",
+                       [Show, Overlap, Merge]>,
+      HelpText<"Zero out the discriminator bits for the FS discriminator "
+               "pass beyond this value.">,
+      Flags<[HelpHidden]>, MetaVarName<"<pass>">;
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 74c4732ca129a..592449729ecc4 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -12,11 +12,18 @@
 
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/SmallSet.h"
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/Debuginfod/HTTPClient.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/Object/Binary.h"
+#include "llvm/Option/Arg.h"
+#include "llvm/Option/ArgList.h"
+#include "llvm/Option/OptTable.h"
+#include "llvm/Option/Option.h"
 #include "llvm/ProfileData/DataAccessProf.h"
 #include "llvm/ProfileData/InstrProfCorrelator.h"
 #include "llvm/ProfileData/InstrProfReader.h"
@@ -35,11 +42,12 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/InitLLVM.h"
+#include "llvm/Support/LLVMDriver.h"
 #include "llvm/Support/MD5.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Regex.h"
+#include "llvm/Support/StringSaver.h"
 #include "llvm/Support/ThreadPool.h"
 #include "llvm/Support/Threading.h"
 #include "llvm/Support/VirtualFileSystem.h"
@@ -47,35 +55,15 @@
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 #include <cmath>
+#include <limits>
 #include <optional>
 
+#include "Opts.inc"
+
 using namespace llvm;
+using namespace llvm::opt;
 using ProfCorrelatorKind = InstrProfCorrelator::ProfCorrelatorKind;
 
-// https://llvm.org/docs/CommandGuide/llvm-profdata.html has documentations
-// on each subcommand.
-cl::SubCommand ShowSubcommand(
-    "show",
-    "Takes a profile data file and displays the profiles. See detailed "
-    "documentation in "
-    "https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-show");
-cl::SubCommand OrderSubcommand(
-    "order",
-    "Reads temporal profiling traces from a profile and outputs a function "
-    "order that reduces the number of page faults for those traces. See "
-    "detailed documentation in "
-    "https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-order");
-cl::SubCommand OverlapSubcommand(
-    "overlap",
-    "Computes and displays the overlap between two profiles. See detailed "
-    "documentation in "
-    "https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-overlap");
-cl::SubCommand MergeSubcommand(
-    "merge",
-    "Takes several profiles and merge them together. See detailed "
-    "documentation in "
-    "https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-merge");
-
 namespace {
 enum ProfileKinds { instr, sample, memory };
 enum FailureMode { warnOnly, failIfAnyAreInvalid, failIfAllAreInvalid };
@@ -90,408 +78,132 @@ enum ProfileFormat {
 };
 
 enum class ShowFormat { Text, Json, Yaml };
-} // namespace
 
-// Common options.
-cl::opt<std::string> OutputFilename("output", cl::value_desc("output"),
-                                    cl::init("-"), cl::desc("Output file"),
-                                    cl::sub(ShowSubcommand),
-                                    cl::sub(OrderSubcommand),
-                                    cl::sub(OverlapSubcommand),
-               ...
[truncated]

@github-actions

github-actions Bot commented Jan 25, 2026 •

Copy link
Copy Markdown

✅ With the latest revision this PR passed the C/C++ code formatter.

@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label Jan 25, 2026
@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 3 times, most recently from 8d66f33 to 481b747 Compare January 25, 2026 19:26
@github-actions

github-actions Bot commented Jan 25, 2026 •

Copy link
Copy Markdown

🐧 Linux x64 Test Results

  • 170207 tests passed
  • 3085 tests skipped
  • 1 test failed

Failed Tests

(click on a test name to see its output)

LLVM

LLVM.tools/llvm-profdata/sample-fs.test
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-profdata show --sample /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/Inputs/sample-fs.proftext --profile-isfs | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/sample-fs.test --check-prefix=SHOW1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-profdata show --sample /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/Inputs/sample-fs.proftext --profile-isfs
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/sample-fs.test --check-prefix=SHOW1
# note: command had no output on stdout or stderr
# RUN: at line 5
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-profdata show --sample /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/Inputs/sample-fs.proftext --profile-isfs --fs-discriminator-pass PassLast | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/sample-fs.test --check-prefix=SHOW1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llvm-profdata show --sample /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/Inputs/sample-fs.proftext --profile-isfs --fs-discriminator-pass PassLast
# .---command stderr------------
# | llvm-profdata: Unknown option `--fs-discriminator-pass'
# | See `llvm-profdata --help`.
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/sample-fs.test --check-prefix=SHOW1
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/tools/llvm-profdata/sample-fs.test --check-prefix=SHOW1
# `-----------------------------
# error: command failed with exit status: 2

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@github-actions

github-actions Bot commented Jan 25, 2026 •

Copy link
Copy Markdown

🪟 Windows x64 Test Results

  • 131799 tests passed
  • 2974 tests skipped
  • 4 tests failed

Failed Tests

(click on a test name to see its output)

LLVM

LLVM.tools/llvm-profdata/invalid-profdata.test
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
echo ":ir"                     > C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo :ir
# note: command had no output on stdout or stderr
# RUN: at line 2
echo "_ZN6Thread5StartEv"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo _ZN6Thread5StartEv
# note: command had no output on stdout or stderr
# RUN: at line 3
echo "# Func Hash:"            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Func Hash:'
# note: command had no output on stdout or stderr
# RUN: at line 4
echo "288793635542036872"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 288793635542036872
# note: command had no output on stdout or stderr
# RUN: at line 5
echo "# Num Counters:"         >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Num Counters:'
# note: command had no output on stdout or stderr
# RUN: at line 6
echo "3"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 3
# note: command had no output on stdout or stderr
# RUN: at line 7
echo "# Counter Values:"       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Counter Values:'
# note: command had no output on stdout or stderr
# RUN: at line 8
echo "0"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 0
# note: command had no output on stdout or stderr
# RUN: at line 9
echo "12"                      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 12
# note: command had no output on stdout or stderr
# RUN: at line 10
echo "12"                      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 12
# note: command had no output on stdout or stderr
# RUN: at line 11
echo "# Num Value Kinds:"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Num Value Kinds:'
# note: command had no output on stdout or stderr
# RUN: at line 12
echo "1"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 1
# note: command had no output on stdout or stderr
# RUN: at line 13
echo "# ValueKind = IPVK_IndirectCallTarget:"       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# ValueKind = IPVK_IndirectCallTarget:'
# note: command had no output on stdout or stderr
# RUN: at line 14
echo "0"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 0
# note: command had no output on stdout or stderr
# RUN: at line 15
echo "# NumValueSites:"                             >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# NumValueSites:'
# note: command had no output on stdout or stderr
# RUN: at line 16
echo "2"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 2
# note: command had no output on stdout or stderr
# RUN: at line 17
echo "2"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 2
# note: command had no output on stdout or stderr
# RUN: at line 18
echo "f1:10"                                        >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo f1:10
# note: command had no output on stdout or stderr
# RUN: at line 19
echo "f2:0"                                         >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo f2:0
# note: command had no output on stdout or stderr
# RUN: at line 20
echo "1"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 1
# note: command had no output on stdout or stderr
# RUN: at line 21
echo ":10"                                          >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo :10
# note: command had no output on stdout or stderr
# RUN: at line 23
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input -text -output=/dev/null 2>&1  | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\invalid-profdata.test --check-prefix=BROKEN
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input' -text -output=/dev/null
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\invalid-profdata.test' --check-prefix=BROKEN
# note: command had no output on stdout or stderr
# RUN: at line 27
echo ":ir"                     > C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo :ir
# note: command had no output on stdout or stderr
# RUN: at line 28
echo "_ZN6Thread5StartEv"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo _ZN6Thread5StartEv
# note: command had no output on stdout or stderr
# RUN: at line 29
echo "# Func Hash:"            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Func Hash:'
# note: command had no output on stdout or stderr
# RUN: at line 30
echo "288793635542036872"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 288793635542036872
# note: command had no output on stdout or stderr
# RUN: at line 31
echo "# Num Counters:"         >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Num Counters:'
# note: command had no output on stdout or stderr
# RUN: at line 32
echo "3"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 3
# note: command had no output on stdout or stderr
# RUN: at line 33
echo "# Counter Values:"       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Counter Values:'
# note: command had no output on stdout or stderr
# RUN: at line 34
echo "0"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 0
# note: command had no output on stdout or stderr
# RUN: at line 35
echo "12"                      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 12
# note: command had no output on stdout or stderr
# RUN: at line 36
echo "12"                      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 12
# note: command had no output on stdout or stderr
# RUN: at line 37
echo "# Num Value Kinds:"      >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# Num Value Kinds:'
# note: command had no output on stdout or stderr
# RUN: at line 38
echo "1"                       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 1
# note: command had no output on stdout or stderr
# RUN: at line 39
echo "# ValueKind = IPVK_IndirectCallTarget:"       >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# ValueKind = IPVK_IndirectCallTarget:'
# note: command had no output on stdout or stderr
# RUN: at line 40
echo "0"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 0
# note: command had no output on stdout or stderr
# RUN: at line 41
echo "# NumValueSites:"                             >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '# NumValueSites:'
# note: command had no output on stdout or stderr
# RUN: at line 42
echo "2"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 2
# note: command had no output on stdout or stderr
# RUN: at line 43
echo "2"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 2
# note: command had no output on stdout or stderr
# RUN: at line 44
echo "f1:10"                                        >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo f1:10
# note: command had no output on stdout or stderr
# RUN: at line 45
echo "f2:0"                                         >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo f2:0
# note: command had no output on stdout or stderr
# RUN: at line 46
echo "1"                                            >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo 1
# note: command had no output on stdout or stderr
# RUN: at line 47
echo "** External Symbol **:10"             >> C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input
# executed command: echo '** External Symbol **:10'
# note: command had no output on stdout or stderr
# RUN: at line 49
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input -text -output=C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.out && cat C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.out | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\invalid-profdata.test
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.input' -text '-output=C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.out'
# .---command stderr------------
# | error: =C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\invalid-profdata.test.tmp.out: invalid argument
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.tools/llvm-profdata/sample-fs.test
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe show --sample C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/sample-fs.proftext -profile-isfs | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\sample-fs.test --check-prefix=SHOW1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' show --sample 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/sample-fs.proftext' -profile-isfs
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\sample-fs.test' --check-prefix=SHOW1
# note: command had no output on stdout or stderr
# RUN: at line 5
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe show --sample C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/sample-fs.proftext -profile-isfs -fs-discriminator-pass PassLast | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\sample-fs.test --check-prefix=SHOW1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' show --sample 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/sample-fs.proftext' -profile-isfs -fs-discriminator-pass PassLast
# .---command stderr------------
# | llvm-profdata: error: unknown command line argument '-input-files' for subcommand 'show'. Try: 'llvm-profdata show --help'
# `-----------------------------
# error: command failed with exit status: 1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\sample-fs.test' --check-prefix=SHOW1
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\sample-fs.test --check-prefix=SHOW1
# `-----------------------------
# error: command failed with exit status: 2

--

LLVM.tools/llvm-profdata/weight-instr.test
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 5
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe show -instr -all-functions C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp > C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' show -instr -all-functions 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 6
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1
# note: command had no output on stdout or stderr
# RUN: at line 7
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2
# note: command had no output on stdout or stderr
# RUN: at line 8
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3
# note: command had no output on stdout or stderr
# RUN: at line 9
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4
# note: command had no output on stdout or stderr
# RUN: at line 10
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 11
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe show -instr -all-functions C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp > C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out2
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' show -instr -all-functions 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 12
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out2
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-1
# note: command had no output on stdout or stderr
# RUN: at line 13
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out2
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-2
# note: command had no output on stdout or stderr
# RUN: at line 14
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out2
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-3
# note: command had no output on stdout or stderr
# RUN: at line 15
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out2
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=1X_1X_WEIGHT,1X_1X_WEIGHT-4
# note: command had no output on stdout or stderr
# RUN: at line 39
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input 5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input '5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 40
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe show -instr -all-functions C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp > C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out3
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' show -instr -all-functions 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 41
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-1 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out3
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-1
# note: command had no output on stdout or stderr
# RUN: at line 42
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-2 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out3
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-2
# note: command had no output on stdout or stderr
# RUN: at line 43
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-3 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out3
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-3
# note: command had no output on stdout or stderr
# RUN: at line 44
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-4 < C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out3
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefixes=3X_5X_WEIGHT,3X_5X_WEIGHT-4
# note: command had no output on stdout or stderr
# RUN: at line 68
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input 0,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input '0,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 69
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input 0.75,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input '0.75,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 70
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input -5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input '-5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 71
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input ,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input ',C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 72
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata -weighted-input C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-bar.profdata' -weighted-input 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-instr-foo.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 76
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist.profdata -weighted-input 2,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist-either.profdata -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -DMSG='no such file or directory' C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=INVALID_INPUT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist.profdata' -weighted-input '2,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist-either.profdata' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' '-DMSG=no such file or directory' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=INVALID_INPUT
# note: command had no output on stdout or stderr
# RUN: at line 80
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -instr -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test -check-prefix=NO_INPUT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -instr -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-instr.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test' -check-prefix=NO_INPUT
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test:81:11: error: NO_INPUT: expected string not found in input
# | NO_INPUT: error: no input files specified. See llvm-profdata{{(\.EXE|\.exe)?}} merge -help
# |           ^
# | <stdin>:1:1: note: scanning from here
# | error: no input files specified. See llvm-profdata merge --help
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-instr.test
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           1: error: no input files specified. See llvm-profdata merge --help 
# | check:81     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

LLVM.tools/llvm-profdata/weight-sample.test
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -text -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=1X_1X_WEIGHT
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -text -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=1X_1X_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 5
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -text -weighted-input 1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=1X_1X_WEIGHT
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -text -weighted-input '1,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=1X_1X_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 24
c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -text -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input 5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=3X_5X_WEIGHT
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -text -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input '5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=3X_5X_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 43
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input 0,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input '0,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 44
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input 0.75,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input '0.75,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 45
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input -5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input '-5,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 46
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input ,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input ',C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 47
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext -weighted-input C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_WEIGHT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-bar.proftext' -weighted-input 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/weight-sample-foo.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_WEIGHT
# note: command had no output on stdout or stderr
# RUN: at line 51
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -weighted-input 3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist.proftext -weighted-input 2,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist-either.proftext -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe -DMSG='no such file or directory' C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=INVALID_INPUT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -weighted-input '3,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist.proftext' -weighted-input '2,C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata/Inputs/does-not-exist-either.proftext' -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' '-DMSG=no such file or directory' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=INVALID_INPUT
# note: command had no output on stdout or stderr
# RUN: at line 55
not c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe merge -sample -o C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test -check-prefix=NO_INPUT
# executed command: not 'c:\_work\llvm-project\llvm-project\build\bin\llvm-profdata.exe' merge -sample -o 'C:\_work\llvm-project\llvm-project\build\test\tools\llvm-profdata\Output\weight-sample.test.tmp.out'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test' -check-prefix=NO_INPUT
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test:56:11: error: NO_INPUT: expected string not found in input
# | NO_INPUT: {{.*}}: no input files specified. See llvm-profdata{{(\.EXE|\.exe)?}} merge -help
# |           ^
# | <stdin>:1:1: note: scanning from here
# | error: no input files specified. See llvm-profdata merge --help
# | ^
# | <stdin>:1:2: note: possible intended match here
# | error: no input files specified. See llvm-profdata merge --help
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\tools\llvm-profdata\weight-sample.test
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: error: no input files specified. See llvm-profdata merge --help 
# | check:56'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# | check:56'1      ?                                                               possible intended match
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 2 times, most recently from 6cf348d to d49e25b Compare January 25, 2026 19:56
@petrhosek

Copy link
Copy Markdown
Member

cc @Prabhuk since this the first real use of SubCommand support in OptTable which he implemented in #155026.

return 1;
}

cl::ParseCommandLineOptions(argc, argv, "LLVM profile data\n");
StringRef Subcommand = argv[1];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be using Args.getSubCommand, see

StringRef SubCommand = Args.getSubCommand(
T.getSubCommands(), HandleMultipleSubcommands, HandleOtherPositionals);

Comment on lines +3573 to +3576
if (Subcommand == "--help" || Subcommand == "-help" || Subcommand == "-h") {
printTopLevelHelp();
return 0;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be using OptTable support as well, see

@dzbarsky

Copy link
Copy Markdown
Contributor Author

@petrhosek Thanks for taking a look - I updated per your comments in a separate commit but not sure if I did it properly, mind taking a look to see if it's what you intended?

@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 2 times, most recently from 68648b9 to 5da6057 Compare January 26, 2026 21:19
@Prabhuk

Prabhuk commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

@dzbarsky -- thank you for the PR. I am interested in reviewing this patch but will be a few days before I can get to this as I am returning from a break. In the meanwhile can you take a look at why the builders are failing? There is no regression tests currently for llvm-profdata --help and for other subcommand help text outputs. Can you also consider adding tests for the help text outputs and/or comment on whether you are seeing the behavior of the tool including help text to be correct after these changes? Thank you.

@Prabhuk

Prabhuk commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

CC: @mingmingl-llvm @teresajohnson -- this PR may be of interest to you.

@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 3 times, most recently from c402d4a to 2b4e33a Compare January 27, 2026 20:55
@dzbarsky

Copy link
Copy Markdown
Contributor Author

@dzbarsky -- thank you for the PR. I am interested in reviewing this patch but will be a few days before I can get to this as I am returning from a break. In the meanwhile can you take a look at why the builders are failing? There is no regression tests currently for llvm-profdata --help and for other subcommand help text outputs. Can you also consider adding tests for the help text outputs and/or comment on whether you are seeing the behavior of the tool including help text to be correct after these changes? Thank you.

No worries, I'll be traveling later this week/weekend to give a talk about LLVM at Fosdem, so I'll also be delayed :)

It looks like CI discovered that there are some cl::Opt definitions in libs that did not get ported; for now I kept a limited form of CL parsing for those, we will need to fix all upstream tools that use them (probably do their own parsing and thread through options), but it feels like too big a change for a single PR. Let mek now if you have any better ideas!

Added some tests for the help outputs.

Comment on lines 612 to 619
static std::string getFuncName(const SampleProfileMap::value_type &Val) {
return Val.second.getContext().toString();
}

template <typename T>
static void filterFunctions(T &ProfileMap) {
template <typename T> static void filterFunctions(T &ProfileMap) {
bool hasFilter = !FuncNameFilter.empty();
bool hasNegativeFilter = !FuncNameNegativeFilter.empty();
if (!hasFilter && !hasNegativeFilter)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These formatting changes can be reverted to preserve blame lines.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try, but I think clang-format insisted on these and CI was red without it. Perhaps the clang-format check got introduced or reconfigured after this code was written?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, the usual recommendation is to reformat the file first as a separate change to minimize the size of the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use git clang-format then it will only attempt to format lines that you have touched, and will leave the other lines (like this) alone.

https://clang.llvm.org/docs/ClangFormat.html#git-integration

Comment on lines 1204 to 1224
@@ -1522,12 +1219,8 @@ remapSamples(const sampleprof::FunctionSamples &Samples,
}

static sampleprof::SampleProfileFormat FormatMap[] = {
sampleprof::SPF_None,
sampleprof::SPF_Text,
sampleprof::SPF_None,
sampleprof::SPF_Ext_Binary,
sampleprof::SPF_GCC,
sampleprof::SPF_Binary};
sampleprof::SPF_None, sampleprof::SPF_Text, sampleprof::SPF_None,
sampleprof::SPF_Ext_Binary, sampleprof::SPF_GCC, sampleprof::SPF_Binary};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. These formatting changes can be reverted.

Comment on lines +3198 to +3202
StringRef V = getOptionValue(A);
if (V.empty()) {
Value = true;
return true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StringRef V = getOptionValue(A);
if (V.empty()) {
Value = true;
return true;
}
StringRef V = getOptionValue(A, /*default=*/"true");

We can simplify this logic if we add a default parameter to getOptionValue().

.Case("PassLast", FSDiscriminatorPass::PassLast)
.Case("pass-last", FSDiscriminatorPass::PassLast)
.Case("passlast", FSDiscriminatorPass::PassLast)
.Default(std::nullopt);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the motivation behind using Opt flag parsing instead of cl::opt? To me this makes options more complicated. For this option, we need to write a whole new function to parse with custom enum values. This leaves opportunity for bugs to creep in.

With cl::opt, enum values are right next to the option definition and there is no need to write custom option parsing code.

static cl::opt<FSDiscriminatorPass> FSDiscriminatorPassOption(
"fs-discriminator-pass", cl::init(PassLast), cl::Hidden,
cl::desc("Zero out the discriminator bits for the FS discrimiantor "
"pass beyond this value. The enum values are defined in "
"Support/Discriminator.h"),
cl::values(clEnumVal(Base, "Use base discriminators only"),
clEnumVal(Pass1, "Use base and pass 1 discriminators"),
clEnumVal(Pass2, "Use base and pass 1-2 discriminators"),
clEnumVal(Pass3, "Use base and pass 1-3 discriminators"),
clEnumVal(PassLast, "Use all discriminator bits (default)")));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, cl::opt "pollutes" the help text by registering flags at static scope, which causes confusion when binaries are linked together into a busybox/multicall driver binary. See 3f52eef for additional context.

I do agree with you that the end code is not necessarily more pleasing, and perhaps cl::opt could have been modified to be compatible with multicall. It seems unfortunate to have multiple flag parsing libraries in the repo without a clear winner.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other reasons beyond the scoping, OptTable is more powerful and generally a better fit for user facing tools (this is especially true when you're trying to match option spelling of existing tools), cl::opt is primarily intended for internal options (e.g. pass flags). https://discourse.llvm.org/t/rfc-llvm-busybox-proposal/58494 more context.

Comment thread llvm/tools/llvm-profdata/llvm-profdata.cpp Outdated
@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 6 times, most recently from 1694628 to 064c27e Compare February 6, 2026 14:19
@dzbarsky

dzbarsky commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

I left some more comments, but in general this change is far bigger than it needs to be because it's trying to match the behavior of cl::opt one-to-one which was never our goal. I'd recommend looking at some of the previous conversions, the description of those changes has more details:

* https://reviews.llvm.org/D105532

* https://reviews.llvm.org/D105598

* https://reviews.llvm.org/D105605

* https://reviews.llvm.org/D105330

* https://reviews.llvm.org/D104889

@petrhosek Thanks for sharing those, I've taken a stab at reworking this PR to align with the semantic flag changes made in the other ones, such as dropping the single-dash long flags for consistency, removing = flags, simplifying bool flag handling, etc. This required a lot of changes to tests but it's a fairly mechanical update and aligns better with other tools, so maybe worth it? Not sure.

Mind taking another look at the llvm-profdata main and let me know if you see additional opportunities to use OptTable better? Would love to get this merged!

return true;
}

static bool parseFSDiscriminatorPassArg(const opt::InputArgList &Args) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if OptTable has a builtin way to model this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like this could work: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Options/Options.td#L9814-L9822

We could combine Values, ValuesCode:

Can you try this?

def fs_discriminator_pass : Joined<["-"], "fs-discriminator-pass=">,
Group<f_Group>,
HelpText<"Set the FS discriminator pass">,
Values<"base,pass1,pass2,pass3,passlast">,
NormalizedValuesScope<"FSDiscriminatorPass">,
MarshallingInfoEnum<"Opts.FSDiscriminatorPass", "Base">,
ValuesCode<[{
return llvm::StringSwitch(Value)
.Case("base", FSDiscriminatorPass::Base)
.Case("pass1", FSDiscriminatorPass::Pass1)
.Case("pass2", FSDiscriminatorPass::Pass2)
.Case("pass3", FSDiscriminatorPass::Pass3)
.Case("passlast", FSDiscriminatorPass::PassLast)
.Default(FSDiscriminatorPass::Base);
}]>;

If the above doesn't work we could still simplify this with the following:

def fs_discriminator_pass : Joined<["-"], "fs-discriminator-pass=">,
Values<"base,pass1,pass2,pass3,passlast">,
HelpText<"Set the FS discriminator pass">;

You can then probably use Value.lowercase() in your StringSwitch check.

return llvm::is_contained(OtherPositionals, Flag) || RawFirstArg == Flag;
};

if (Args.hasArg(OPT_help) || HasRawFlag("--help")) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even as top-level options I was seeing these not resolving if no command was selected, so needed this workaround. Maybe I missed something?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide an example invocation and what case is not being handled correctly?

IIUC you are trying to handle the help flag here. You should be passing the helptext from your Opts.td file which you seem to be doing. So I cant fathom what is the purpose of this help text handling. If the library is not handling this correctly we must fix that first anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I debugged this a bit, the problem was Tbl.parseArgs(argc - 1, argv + 1, OPT_UNKNOWN, Saver, [&](StringRef Msg) { which was dropping the first arg (--help). thanks for the prod

Comment thread compiler-rt/test/profile/AIX/pgo-lto-bcdtor-function-section.test Outdated
Comment thread llvm/docs/MemProf.rst Outdated
Comment thread llvm/test/tools/llvm-cov/Inputs/yaml.makefile Outdated
Comment thread llvm/test/tools/llvm-cov/mcdc-const.test Outdated
Comment thread llvm/tools/llvm-profdata/CMakeLists.txt Outdated
Comment thread llvm/tools/llvm-profdata/llvm-profdata.cpp Outdated
Comment thread llvm/tools/llvm-profdata/llvm-profdata.cpp Outdated
Comment thread llvm/tools/llvm-profdata/llvm-profdata.cpp Outdated
Comment thread llvm/tools/llvm-profdata/llvm-profdata.cpp Outdated
return llvm::is_contained(OtherPositionals, Flag) || RawFirstArg == Flag;
};

if (Args.hasArg(OPT_help) || HasRawFlag("--help")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide an example invocation and what case is not being handled correctly?

IIUC you are trying to handle the help flag here. You should be passing the helptext from your Opts.td file which you seem to be doing. So I cant fathom what is the purpose of this help text handling. If the library is not handling this correctly we must fix that first anyway.

@dzbarsky
dzbarsky force-pushed the llvm-profdata branch 5 times, most recently from 008a1a8 to 205ed1a Compare February 16, 2026 02:19
@dzbarsky

Copy link
Copy Markdown
Contributor Author

@Prabhuk I've addressed your feedback, please take another look

@@ -10,13 +10,20 @@
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/ArrayRef.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this header include is not needed. Please check if this header include and others from ADT are necessary and remove if not needed:
https://llvm.org/docs/CodingStandards.html#include-as-little-as-possible

Comment on lines +686 to +687
const uint64_t TraceReservoirSize = TemporalProfTraceReservoirSize;
const uint64_t MaxTraceLength = TemporalProfMaxTraceLength;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These local variables are not used. Please remove.

@@ -3424,7 +3122,7 @@ static int order_main() {
ArrayRef Traces = Reader->getTemporalProfTraces();
if (NumTestTraces && NumTestTraces >= Traces.size())
exitWithError(
"--" + NumTestTraces.ArgStr +
"--num-test-traces"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you include this line into the string literal in the following line and remove this line?

return true;
}

static bool parseFSDiscriminatorPassArg(const opt::InputArgList &Args) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like this could work: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Options/Options.td#L9814-L9822

We could combine Values, ValuesCode:

Can you try this?

def fs_discriminator_pass : Joined<["-"], "fs-discriminator-pass=">,
Group<f_Group>,
HelpText<"Set the FS discriminator pass">,
Values<"base,pass1,pass2,pass3,passlast">,
NormalizedValuesScope<"FSDiscriminatorPass">,
MarshallingInfoEnum<"Opts.FSDiscriminatorPass", "Base">,
ValuesCode<[{
return llvm::StringSwitch(Value)
.Case("base", FSDiscriminatorPass::Base)
.Case("pass1", FSDiscriminatorPass::Pass1)
.Case("pass2", FSDiscriminatorPass::Pass2)
.Case("pass3", FSDiscriminatorPass::Pass3)
.Case("passlast", FSDiscriminatorPass::PassLast)
.Default(FSDiscriminatorPass::Base);
}]>;

If the above doesn't work we could still simplify this with the following:

def fs_discriminator_pass : Joined<["-"], "fs-discriminator-pass=">,
Values<"base,pass1,pass2,pass3,passlast">,
HelpText<"Set the FS discriminator pass">;

You can then probably use Value.lowercase() in your StringSwitch check.

@dzbarsky

Copy link
Copy Markdown
Contributor Author

@Prabhuk thanks for taking a look, I couldn't get the MarshallingInfoEnum to work but I made the 2nd change you suggested (explicit enum values and Value.lowercase()). Any other feedback before we can merge?

Comment on lines 3248 to 3252

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using one option parser only to construct a string and feed it to another option parser just adds unnecessary complexity. Can you instead parse these options directly just like the other ones?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a code smell; the reason for it is that those cl::Opt are defined deeper in a library instead of in the main file, and are used by other tools as well. Given the size of this change, I felt that untangling that would be better left to a subsequent PR

@petrhosek

Copy link
Copy Markdown
Member

I'd like to avoid changing all the tests and also potentially breaking downstream users who rely on the old flag spelling. I also don't think it's necessary. For example, rather than changing all instances of -output= to --output=, you can simply define the option as:

def output : JoinedOrSeparate<["-", "--"], "output",
                               [Show, Order, Overlap, Merge]>,
             MetaVarName<"<output>">,
             HelpText<"Output file">;

@dzbarsky

dzbarsky commented Mar 1, 2026 •

Copy link
Copy Markdown
Contributor Author

I'd like to avoid changing all the tests and also potentially breaking downstream users who rely on the old flag spelling. I also don't think it's necessary. For example, rather than changing all instances of -output= to --output=, you can simply define the option as:

def output : JoinedOrSeparate<["-", "--"], "output",
                               [Show, Order, Overlap, Merge]>,
             MetaVarName<"<output>">,
             HelpText<"Output file">;

OK, I can undo that, that's what I had done originally but then changed to the current approach based off your comment here #177868 (comment) since the other PRs also made similar changes. I'll revert these bits, but it would be great to avoid more confusion/ping-ponging here, especially given the time between review cycles :)

@dzbarsky

dzbarsky commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

@petrhosek Do you also want to support --foo=bar form in addition to --foo bar form across flags? That's the other bit that changed to align with the previous migration PRs. I don't care one way or another, I just want to clear the path to merging this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:X86 bazel "Peripheral" support tier build system: utils/bazel BOLT compiler-rt llvm:binary-utilities llvm:transforms PGO Profile Guided Optimizations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants